//
//  MapView.swift
//  FuncFanc
//
//  Created by careate-hubing on 2021/12/15.
//  Copyright © 2021 huhu. All rights reserved.
//

import SwiftUI
import MapKit



@available(iOS 13.0, *)
struct MapView: UIViewRepresentable {
    func makeUIView(context: Context) -> MKMapView {
        return MKMapView(frame: .zero)
    }
    func updateUIView(_ uiView: MKMapView, context: Context) {
        let coordinate = CLLocationCoordinate2D(latitude: 34.19278, longitude: 119.4312)
        let span = MKCoordinateSpan(latitudeDelta: 2.0, longitudeDelta: 2.0)
        let region = MKCoordinateRegion(center: coordinate, span: span)
        uiView.setRegion(region, animated: true)
    }
}

struct MapView_Previews: PreviewProvider {
    @available(iOS 13.0.0, *)
    static var previews: some View {
        MapView()
    }
}
